package jvs.sh;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import jvs.peer.io.FileTransfer.Monitor;
import jvs.vfs.sec.AccessControl;
import jvs.vfs.sec.Group;
import jvs.vfs.sec.Role;
import jvs.vfs.sec.User;
import java.io.File;

public interface IShell {

	public abstract void abort() throws Exception;

	//public abstract void addNote(File f, String note) throws Exception;

	public abstract void ant(File buildfile, String target, boolean verbose,
			Appendable logger) throws Exception;

	public abstract void attr(File f, StringBuilder sb, String crlf)
			throws Exception;

	public abstract void bsh(File f, ByteArrayOutputStream bos)
			throws Exception;

	public abstract void bsh(String data, ByteArrayOutputStream bos)
			throws Exception;

	public abstract void buzz(String param) throws Exception;

	public abstract String cat(File f) throws Exception;

	public abstract void chdir() throws Exception;
	
	public abstract void chdir(File f) throws Exception;

	public abstract void checkAuth(File f);
	
	public abstract String checksum(File file, String arg) throws Exception;

	public abstract File[] classpath() throws Exception;

	public abstract void connect(User user) throws Exception;

	public abstract void copy(File from, File to) throws Exception;

	public abstract String date(String fmt) throws Exception;

	public abstract String decode(String s) throws Exception;

	public abstract boolean delete(File f) throws Exception;

	public abstract void dex(String param) throws Exception;

	//public abstract void df(StringBuilder sb, String crlf) throws Exception;

	public abstract int dir(File f, StringBuilder sb, String crlf)
			throws Exception;

	//public abstract long du(File f, List<File> trail) throws Exception;

	//public abstract void edit(String txt, File f) throws Exception;

	public abstract String encode(String s) throws Exception;
	
	public abstract void ensureAdmin();
	
	public abstract Map<String, String> env() throws Exception;

	public abstract void exit() throws Exception;

	//public abstract void find(File dir, String pattern, List<File> out,
	//		List<File> trail) throws Exception;

	public abstract String format(Date date) throws Exception;

	public abstract File getCwd() throws Exception;

	public abstract String getEnv(String n) throws Exception;

	public abstract String getName() throws Exception;

	public abstract Set<Role> getRoles() throws Exception;

	public abstract User getUser() throws Exception;

	public abstract Role grant(Role.Type type, String group) throws Exception;

	//public abstract void grep(File f, String pattern, List<String> out)
	//		throws Exception;

	public abstract String head(File f, int max) throws Exception;

	public abstract String help() throws Exception;

	public abstract String help(String cmd) throws Exception;

	public abstract String id();

	public abstract void info(File f, StringBuilder sb, String crlf)
			throws Exception;

	public abstract void init() throws Exception;

	public abstract boolean isConnected() throws Exception;

	public abstract boolean isVerbose() throws Exception;

	//public abstract void javac(File src, File outdir, Appendable logger)
	//		throws Exception;

	public abstract void java(String[] args) throws Exception;

	//public abstract void link(File f, String u, String opt) throws Exception;

	public abstract int list(File file, int off, int max, StringBuilder out)
			throws Exception;

	//public abstract int listp(File file, Pattern pattern,
	//		List<File> out) throws Exception;

	//public abstract int listZip(File file, int off, int max,
	//		List<ZipEntry> out) throws Exception;

	//public abstract int listZip(File file, Pattern pattern,
	//		List<ZipEntry> out) throws Exception;

	public abstract void mail(String to, File f) throws Exception;

	public abstract boolean mkdirs(File f) throws Exception;

	public abstract String motd() throws Exception;

	//public abstract void mount(File mp, String uri, String opt)
	//		throws Exception;

	public abstract boolean move(File from, File to) throws Exception;

	//public abstract NoteIterator notes(File f, String crlf) throws Exception;
	
	public abstract boolean ping(String peer) throws Exception;

	public abstract String plan() throws Exception;

	public abstract void pull(File f, OutputStream out) throws Exception;

	public abstract Monitor receive(File f) throws Exception;

	public abstract File resolveFile(String path) throws Exception;

	public abstract void revoke(Role.Type type, String group) throws Exception;

	public abstract boolean rmdir(File f) throws Exception;

	public abstract Monitor send(String to, File file) throws Exception;
	
	public abstract void setAccessControl(AccessControl accessControl)
			throws Exception;

	public abstract void setCwd(File cwd) throws Exception;

	public abstract void setEnv(String n, String v) throws Exception;

	public abstract void setLastAccess(long lastAccess) throws Exception;

	public abstract void setRoles(Set<Role> roles) throws Exception;

	public abstract void setRoot(File root) throws Exception;

	public abstract void shell(String param) throws Exception;

	public abstract void terminate(User user) throws Exception;

	public abstract boolean touch(File f) throws Exception;

	//public abstract void unlink(File f) throws Exception;

	//public abstract void unmount(String mp) throws Exception;

	public abstract String unset(String n) throws Exception;

	public abstract List<User> who() throws Exception;

	public abstract void write(String to, String msg) throws Exception;

	public abstract File getHome() throws Exception;

	public abstract List<Group> groups() throws Exception;

	public abstract List<Group> groups(String user) throws Exception;

	public abstract void addGroup(String group) throws Exception;

	public abstract void removeGroup(String group) throws Exception;

	public abstract void updateGroup(String oldid, String newid) throws Exception;

	public abstract List<User> users() throws Exception;

	public abstract List<User> users(String group) throws Exception;

	public abstract void addUser(String uid, String name, String gid) throws Exception;

	public abstract void removeUser(String uid, String gid) throws Exception;

	public abstract void updateUser(String uid, String name) throws Exception;

	public abstract void thumbnail(File f, OutputStream data) throws Exception;

	public abstract void icon(File f, OutputStream data) throws Exception;

	public abstract String ip() throws Exception;

}